<html>
<head><meta charset="utf-8"><title>MCP for #72709: `#[deny(unsafe_op_in_unsafe_fn)]` in liballo · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/MCP.20for.20.2372709.3A.20.60.23.5Bdeny(unsafe_op_in_unsafe_fn).5D.60.20in.20liballo.html">MCP for #72709: `#[deny(unsafe_op_in_unsafe_fn)]` in liballo</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="200153035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/MCP%20for%20%2372709%3A%20%60%23%5Bdeny%28unsafe_op_in_unsafe_fn%29%5D%60%20in%20liballo/near/200153035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/MCP.20for.20.2372709.3A.20.60.23.5Bdeny(unsafe_op_in_unsafe_fn).5D.60.20in.20liballo.html#200153035">(Jun 08 2020 at 20:38)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/72709">#72709</a> proposes to deny bare unsafe operations in unsafe functions (i.e. without an explicit <code>unsafe</code> block) in liballoc.<br>
As noted by <span class="user-mention" data-user-id="116009">@nikomatsakis</span>:</p>
<blockquote>
<p>I suppose an MCP might be appropriate actually, this feels like a kind of "policy question".</p>
</blockquote>
<p>So I was wondering if MCP are adapted for library changes, if an MCP is needed, and if so if I should write it up <span aria-label="note" class="emoji emoji-1f4dd" role="img" title="note">:note:</span></p>
<p>I know that the compiler team has already been pinged on the GitHub PR, but since I expect to have to write the MCP (which doesn't bother me at all) I wanted to create a Zulip thread to be able to ask questions more freely.</p>
<p>cc <span class="user-mention" data-user-id="116083">@pnkfelix</span> <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> <span class="user-mention" data-user-id="120791">@RalfJ</span> <span class="user-mention" data-user-id="116122">@simulacrum</span> (I hope that pings don't bother anyone <span aria-label="confused" class="emoji emoji-1f615" role="img" title="confused">:confused:</span>)</p>



<a name="200153173"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/MCP%20for%20%2372709%3A%20%60%23%5Bdeny%28unsafe_op_in_unsafe_fn%29%5D%60%20in%20liballo/near/200153173" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/MCP.20for.20.2372709.3A.20.60.23.5Bdeny(unsafe_op_in_unsafe_fn).5D.60.20in.20liballo.html#200153173">(Jun 08 2020 at 20:39)</a>:</h4>
<p>MCP seems like a good idea. I would be willing to second it, I think it's a good idea though maybe not the end (there's been some thoughts on the tracking issue I need to read and reply to)</p>



<a name="200155595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/MCP%20for%20%2372709%3A%20%60%23%5Bdeny%28unsafe_op_in_unsafe_fn%29%5D%60%20in%20liballo/near/200155595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/MCP.20for.20.2372709.3A.20.60.23.5Bdeny(unsafe_op_in_unsafe_fn).5D.60.20in.20liballo.html#200155595">(Jun 08 2020 at 21:02)</a>:</h4>
<p>Oh, I didn't know that a stream on Zulip is created for each MCP. Sorry for the noise</p>



<a name="200167234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/MCP%20for%20%2372709%3A%20%60%23%5Bdeny%28unsafe_op_in_unsafe_fn%29%5D%60%20in%20liballo/near/200167234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/MCP.20for.20.2372709.3A.20.60.23.5Bdeny(unsafe_op_in_unsafe_fn).5D.60.20in.20liballo.html#200167234">(Jun 08 2020 at 23:19)</a>:</h4>
<p>(Looks like the MCP issue template was updated, and the new one is indeed much better. :-)</p>



<a name="201442781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/MCP%20for%20%2372709%3A%20%60%23%5Bdeny%28unsafe_op_in_unsafe_fn%29%5D%60%20in%20liballo/near/201442781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/MCP.20for.20.2372709.3A.20.60.23.5Bdeny(unsafe_op_in_unsafe_fn).5D.60.20in.20liballo.html#201442781">(Jun 19 2020 at 21:37)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> In <a href="https://github.com/rust-lang/compiler-team/issues/306">compiler-team#306</a>, you said:</p>
<blockquote>
<p>I'd like us to see more this feature "weathers" in libstd</p>
</blockquote>
<p>As a non-native English speaker I’m not sure I understood that sentence correctly. Do you want to see the feature in more crates of the standard library? And if so, shall I continue to do it by hand, or would it be better to wait until there is a machine-applicable suggestion for adding the <code>unsafe</code> blocks automatically? Should I open an MCP for that?</p>
<p>Thanks in advance for your answers <span aria-label="big smile" class="emoji emoji-1f604" role="img" title="big smile">:big_smile:</span></p>



<a name="201472683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/MCP%20for%20%2372709%3A%20%60%23%5Bdeny%28unsafe_op_in_unsafe_fn%29%5D%60%20in%20liballo/near/201472683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/MCP.20for.20.2372709.3A.20.60.23.5Bdeny(unsafe_op_in_unsafe_fn).5D.60.20in.20liballo.html#201472683">(Jun 20 2020 at 10:50)</a>:</h4>
<p>I think niko meant they'd like to see more libstd crates use it so we can get some real-world experience with this feature.</p>



<a name="201472688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/MCP%20for%20%2372709%3A%20%60%23%5Bdeny%28unsafe_op_in_unsafe_fn%29%5D%60%20in%20liballo/near/201472688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/MCP.20for.20.2372709.3A.20.60.23.5Bdeny(unsafe_op_in_unsafe_fn).5D.60.20in.20liballo.html#201472688">(Jun 20 2020 at 10:51)</a>:</h4>
<p><span class="user-mention" data-user-id="255061">@LeSeulArtichaut</span> thanks for not just implementing the RFC but also pushing it through liballoc, btw :)</p>



<a name="201472732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/MCP%20for%20%2372709%3A%20%60%23%5Bdeny%28unsafe_op_in_unsafe_fn%29%5D%60%20in%20liballo/near/201472732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/MCP.20for.20.2372709.3A.20.60.23.5Bdeny(unsafe_op_in_unsafe_fn).5D.60.20in.20liballo.html#201472732">(Jun 20 2020 at 10:52)</a>:</h4>
<p>when writing an RFC I am sometimes worried to be on the hook for implementing it (and that has happened in the past), but here I just had to write the spec, which is a great experience :)</p>



<a name="201473345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/MCP%20for%20%2372709%3A%20%60%23%5Bdeny%28unsafe_op_in_unsafe_fn%29%5D%60%20in%20liballo/near/201473345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/MCP.20for.20.2372709.3A.20.60.23.5Bdeny(unsafe_op_in_unsafe_fn).5D.60.20in.20liballo.html#201473345">(Jun 20 2020 at 11:10)</a>:</h4>
<p>I'm glad my contribution was useful <span aria-label="grinning face with smiling eyes" class="emoji emoji-1f601" role="img" title="grinning face with smiling eyes">:grinning_face_with_smiling_eyes:</span></p>



<a name="201621224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/MCP%20for%20%2372709%3A%20%60%23%5Bdeny%28unsafe_op_in_unsafe_fn%29%5D%60%20in%20liballo/near/201621224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/MCP.20for.20.2372709.3A.20.60.23.5Bdeny(unsafe_op_in_unsafe_fn).5D.60.20in.20liballo.html#201621224">(Jun 22 2020 at 15:34)</a>:</h4>
<p>Opened <a href="https://github.com/rust-lang/rust/issues/73622">#73622</a> for continuing with <code>liballoc</code> <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>